package com.jams.goodox.activity.home;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.MediaController;
import android.widget.VideoView;

import com.jams.goodox.R;

/**
 * Created by Administrator on 2017/10/8.
 */

public class VideoActivity extends Activity{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.surface_activity);
        String url=getIntent().getStringExtra("url");
        if(TextUtils.isEmpty(url))return;
//        Uri uri = Uri.parse("android.resource://"+getPackageName()+"/raw/"+R.raw.mine_video);
        Uri uri = Uri.parse(url);
        VideoView videoView = (VideoView)this.findViewById(R.id.video_view);
        videoView.setMediaController(new MediaController(this));
        videoView.setVideoURI(uri);
        videoView.start();
        videoView.requestFocus();
    }
}
